package com.mszlu.blog.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mszlu.blog.dao.dos.Archives;
import com.mszlu.blog.dao.pojo.Article;
import com.mszlu.blog.vo.ArticleDetailVo;
import com.mszlu.blog.vo.ArticleHotVo;
import com.mszlu.blog.vo.Result;

import java.util.List;

public interface ArticleMapper extends BaseMapper<Article> {
    /**
     * 最热文章
     * @return
     */
    List<ArticleHotVo> findArticleHot();

    /**
     * 通过年月分组
     * @return
     */
    List<Archives> findByYear();

    /**
     * 文章详情
     * @param id
     * @return
     */
    ArticleDetailVo findArticleById(Long id);


    IPage<Article> listArticle(Page<Article> page,
                               Long categoryId,
                               Long tagId,
                               String year,
                               String month
                               );
}
